package linker.plugin;

import java.io.FileNotFoundException;
import java.io.IOException;

/**
 * 
 * @version linker 0.93
 * @author Jianfeng jianfeng.linker@gmail.com
 * 
 */

public class ReadClassFromFile extends ClassLoader {

	public Class getClass(String file, String className) {
		try {
			java.io.FileInputStream in = new java.io.FileInputStream(file);

			byte[] bytes;
			bytes = new byte[in.available()];
			in.read(bytes);

			return defineClass(null, bytes, 0, bytes.length);
		} catch (FileNotFoundException e) {
			e.printStackTrace();
		} catch (IOException e) {
			e.printStackTrace();
		}

		return null;
	}

}
